package org.example;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

public class App1 {
    public static void main(String[] args) {
        //1,获得Spring对象上下文
        BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("spring-config.xml"));
        //2,获取指定的Bean对象
        Student student = beanFactory.getBean("student", Student.class);
        //3,使用Bean对象(非必须）
        student.sayHi();
    }
}
